// 这里没有解决跨域问题，但可以通过后解决跨域问题在后端的Controller层使用@CrossOrigin
import request from '../utils/request'


export function getImportList(currentPage, pageSize) {
  return request({
    url: '/import',
    method: 'get',
    params: {
      currentPage,
      pageSize
    }
  })
}

export function getImport(importId) {
  return request({
    url: '/import/' + importId,
    method: 'get',
  })
}


export function addImport(data,importGoods) {
  return request({
    url: '/import',
    method: 'post',
    data: {
      ...data,
      importGoods:JSON.stringify(importGoods)
    }
  })
}

export function findImport(flag, data, currentPage, pageSize) {
  return request({
    url: '/import/find',
    method: 'get',
    params: {
      flag,
      data,
      currentPage,
      pageSize
    }
  })
}

export function editImport(data) {
  return request({
    url: '/import',
    method: 'put',
    data: {
      ...data
    }
  })
}

export function deleteImport(importIds) {
  return request({
    url: '/import/' + importIds,
    method: 'delete',
  })
}


